import bus from '@/bus'
import { renderButton } from '@/util'
let data = {
  status: 'pass',
  totalItem: 1,
  pageSize: window.$pageSize,
  currentPage: 1,
  form: {
    name: '',
    contactMobile: '',
    contactName: '',
    brandId: '',
    officeId: '',
    departmentId: ''
  },
  columns: [{
    type: 'selection',
    width: 60,
    align: 'left',
    fixed: 'left'
  }, {
    title: '公司名称',
    key: 'distributorName',
    align: 'left',
    minWidth: 250,
    tooltip: true
  }, {
    title: 'erp助记码',
    key: 'sourceBtypeEasyCode',
    minWidth: 150,
    render: (h, p) => {
      return <div>{p.row.sourceBtypeEasyCode || '-'}</div>
    }
  }, {
    title: '联系人姓名',
    key: 'distributorContact',
    align: 'left',
    minWidth: 150,
    tooltip: true
  }, {
    title: '联系人手机',
    key: 'distributorMobile',
    align: 'left',
    minWidth: 150
  }, {
    title: '品牌',
    key: 'bindBrandNames',
    align: 'left',
    minWidth: 200,
    tooltip: true
  }, {
    title: '省-市-区',
    key: 'area',
    align: 'left',
    minWidth: 300,
    tooltip: true
  }, {
    title: '科室',
    key: 'bindDepartmentName',
    align: 'left',
    minWidth: 120
  }, {
    title: '部门',
    key: 'bindDepartmentChildName',
    align: 'left',
    minWidth: 150
  }, {
    title: '创建日期',
    key: 'createDate',
    align: 'left',
    minWidth: 200
  }, {
    title: '操作',
    align: 'left',
    width: 200,
    fixed: 'right',
    render: (h, params) => {
      return (
        <div>
          { renderButton(h, { text: '详情' }, () => { bus.$emit('editRow', params.row) })}
          { renderButton(h, { text: '绑定', type: 'primary' }, () => { bus.$emit('bindRow', params.row) }) }
          { renderButton(h, { text: '解约', type: 'primary' }, () => { bus.$emit('unbind', params.row) }) }
        </div>
      )
    }
  }],
  data: [{}]
}
export default data
